#include <iostream>
#include <vector>
using namespace std;

int n, k;
string txt;
string pat = "mihoyo";
int main() {
    cin >> n >> k;
    cin >> txt;
    vector<int> mi;
    for(int i=0;i<n-6;i++){
        int j = 0,k=i;
        while(txt[k] == pat[j]){
            j++;k++;
        }
        if(j == 6) mi.emplace_back(i);
    }
    if (mi.size() < k) {
        cout << mi.size() << endl;
        cout << -1 << endl;
        return 0;
    }
    int l = mi[0], r = mi[k - 1] + 5;
    int minLen = r - l + 1;
    for (int i = 0; i <= mi.size() - k; i++) {
        if (mi[i + k - 1] + 5 - mi[i] + 1 < minLen) {
            minLen = mi[i + k - 1] + 5 - mi[i] + 1;
            l = mi[i];
            r = mi[i + k - 1] + 5;
        }
    }
    cout << l << " " << r << endl;

    return 0;
}